<?php get_header(); ?>

<div id="content" class="author">
<?php
if(get_query_var('author_name')) :
$curauth = get_userdatabylogin(get_query_var('author_name'));
else :
$curauth = get_userdata(get_query_var('author'));
endif;
?>

	<div class="authorbox">
	<p class="title">About the Author</p>
	<?php
	if (function_exists('get_avatar')) {
		echo get_avatar($curauth->user_email, '96');
	} else {
	//alternate gravatar code for < 2.5
	$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=" . md5($curauth->user_email) . "&default=" . urlencode($default) . "&size=96";
		echo '<img class="avatar" src="$grav_url"/>';
	} ?>
	<p><strong>Name:</strong> <?php echo $curauth->display_name; ?></p>
	<p><strong>Web Site:</strong> <?php if($curauth->user_url) echo '<a href="'.$curauth->user_url.'">Link</a>'; ?></p>
	<p><strong>Bio:</strong>
	<?php echo $curauth->description; ?></p>
		
	</div>
	
    <?php if (have_posts()) : $i = 1; // the loop ?>
    <div class="posts">
    <h2>Articles posted by <?php echo $curauth->display_name; ?></h2>
    <?php while (have_posts()) : the_post(); // the loop ?>
    <?php if ($i <= 7) : ?>
	    <div class="post clearfix">
	    <?php image_attachment('mct_sl_image', '100', '100'); ?>
	    <h3 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
	    <div class="meta">By <?php the_author_posts_link(); ?> &bull; on <?php the_time('F j, Y') ?></div>
	    <p><?php prox_content_limit(150,''); ?></p>
		</div><!--end .post-->
	<?php else : ?> 
	<?php if ($i == 8) echo '</div><div id="headlines"><h2>More from this Author</h2>'; ?>
	    <div class="post">
	    <h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	    <p><?php prox_content_limit(200,''); ?></p>
	    </div>
    <?php endif; $i = $i + 1; endwhile; //end one post ?>
    </div>
    
    <!-- Previous/Next page navigation -->
    <div class="page-nav">
	    <div class="nav-previous"><?php previous_posts_link(__('&larr; Previous Page')) ?></div>
	    <div class="nav-next"><?php next_posts_link(__('Next Page &rarr;')); ?></div>
    </div>   
                
	<?php else : //do not delete ?>

    <h3><?php _e("Page Not Found"); ?></h3>
    <p><?php _e("We're sorry, but the page you are looking for isn't here."); ?></p>
    <p><?php _e("Try searching for the page you are looking for or using the navigation in the header or sidebar"); ?></p>

	<?php endif; //do not delete ?>
		
</div><!--end #content-->

<!--include sidebar-->
<?php get_sidebar(); ?>

<!--include footer-->
<?php get_footer(); ?>